Skip to content

feat: paginated event archive pruning#752

Merged
greatest0fallt1me merged 1 commit into
Predictify-org:masterfrom
NEA-DEV-coder:task/event-archive-pruning
Jun 28, 2026
Merged

feat: paginated event archive pruning#752
greatest0fallt1me merged 1 commit into
Predictify-org:masterfrom
NEA-DEV-coder:task/event-archive-pruning

Conversation

@NEA-DEV-coder

Copy link
Copy Markdown
Contributor

Summary

Implements paginated event archive pruning for issue #722.

The PruneCursor struct and prune_archive function already existed. This PR adds:

  • Updated module-level rustdoc documenting the multi-page pruning loop pattern
  • 7 focused unit tests directly exercising the cursor mechanism

Tests added (event_archive.rs)

Test What it covers
test_prune_archive_none_cursor_starts_from_beginning None cursor starts at index 0
test_prune_archive_cursor_resume_continues_from_last_position Cursor passed back in resumes correctly (multi-page)
test_prune_archive_done_flag_set_when_exhausted done=true when count exceeds remaining entries
test_prune_archive_done_cursor_is_idempotent Calling with a done cursor removes nothing
test_prune_archive_preserves_oldest_first_order Entries pruned oldest-first regardless of insert order
test_prune_archive_count_capped_at_max_query_limit count capped at MAX_QUERY_LIMIT=30
test_prune_archive_partial_page_then_done Partial last page correctly sets done=true

Closes

Closes #722

- Document paginated pruning cursor pattern in module-level rustdoc
- Add seed_archive test helper for direct storage state setup
- Add 7 focused unit tests covering:
  * None cursor starts from beginning
  * Cursor resume continues from last position (multi-page)
  * done flag set when archive exhausted
  * done cursor is idempotent (no double-removal)
  * Oldest-first ordering preserved regardless of insertion order
  * count capped at MAX_QUERY_LIMIT
  * Partial last page sets done correctly

Closes Predictify-org#722
@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@NEA-DEV-coder Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@greatest0fallt1me greatest0fallt1me merged commit 713f9cc into Predictify-org:master Jun 28, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add EventArchive paginated pruning cursor

2 participants